<?= $this->doctype() ?> <!-- This Line will output the doctype we set inside the bootstrap file -->
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title><?php echo $this->title ?></title>
	<!--
	  headLink and headScript imported using php
	-->
	<?php 
		$this->headLink()->appendStylesheet('/css/recipe.css');
		$this->headScript()->appendFile('/js/functions.js');
		
		// @todo Maybe move these to a Jquery include -->
		$this->headLink()->appendStylesheet('/css/jquery.wysiwyg.css'); 
		$this->headLink()->appendStylesheet('/css/jquery-ui-1.7.2.custom.css');
		$this->headLink()->appendStylesheet('/css/jquery.autocomplete.css');
		
		$this->headScript()->appendFile('/js/jquery-1.4.2.min.js');
		$this->headScript()->appendFile('/js/jquery-ui-1.7.2.custom.min.js');
		$this->headScript()->appendFile('/js/jquery.autocomplete.pack.js');
		 
		// RTF editor in jquery
		$this->headScript()->appendFile('/js/jquery.wysiwyg.js');
		echo $this->headLink(), $this->headScript(); 
	?>
	
	<script type="text/javascript">
		$(document).ready(function() {
		      $('#wysiwyg').wysiwyg({
		    	    controls: {
		    	  
		          strikeThrough : { visible : false },
		          underline     : { visible : true },
		          
		          separator00 : { visible : false },
		          
		          justifyLeft   : { visible : false },
		          justifyCenter : { visible : false },
		          justifyRight  : { visible : false },
		          justifyFull   : { visible : false },
		          
		          separator01 : { visible : false },
		          
		          indent  : { visible : false },
		          outdent : { visible : false },
		          
		          separator02 : { visible : true },
		          
		          subscript   : { visible : false },
		          superscript : { visible : false },
		          
		          separator03 : { visible : false },
		          
		          undo : { visible : true },
		          redo : { visible : true },
		          
		          separator04 : { visible : true },
		          
		          insertOrderedList    : { visible : true },
		          insertUnorderedList  : { visible : true },
		          insertHorizontalRule : { visible : false },

		          separator05 : { visible : false },
		          
		          createLink   : { visible : false },
		    	  insertImage  : { visible : false },

		    	  separator06 : { visible : false },

		    	  h1 : { visible : false },
		          h2 : { visible : false },
		          h3 : { visible : false },
		          
		          h4mozilla : { visible : false && $.browser.mozilla, className : 'h4', command : 'heading', arguments : ['h4'], tags : ['h4'], tooltip : "Header 4" },
		          h5mozilla : { visible : false && $.browser.mozilla, className : 'h5', command : 'heading', arguments : ['h5'], tags : ['h5'], tooltip : "Header 5" },
		          h6mozilla : { visible : false && $.browser.mozilla, className : 'h6', command : 'heading', arguments : ['h6'], tags : ['h6'], tooltip : "Header 6" },
		          
		          h4 : { visible : false },
		          h5 : { visible : false },
		          h6 : { visible : false },
		          
		          separator07 : { visible : true },
		          
		          cut   : { visible : true },
		          copy  : { visible : true },
		          paste : { visible : true }
		        }
		      });
		});
	</script>

</head> 
<body>

	<!-- Messages to users -->
	<div>
		<div id="notice" class="notice">
		<?php // foreach( $this->message->getMessages() as $msg ): ?>
			<?php // echo $msg; ?>
		<?php // endforeach ?>
		</div>

		<?php // $this->message->setNameSpace('error') ?>
		<div id="error" class="error">
		<?php // foreach( $this->message->getMessages() as $msg ): ?>
			<?php // echo $msg; ?>
		<?php // endforeach ?>
		</div>
	</div>
	<!-- end Messages to users -->
	
	<?php echo $this->render('includes/user_details.php') ?>
	
	<!-- Navigation -->
	<div id="menu">
	<ul>
		<li><h2><a href="/">Home</a></h2></li>
	</ul>
	<ul>
	<?php if ( $this->identity ): ?>
		<li><h2>You</h2>
		<ul>
			<li><a href="/user/edit">My Account</a></li>	
			<li><a href="<?php echo '/recipe/user/user_id/'.strtolower($this->identity->name) ?>">My Recipes</a></li>	
			<li><a href="<?php echo $this->url( array( 
			'controller' => 'recipe', 
			'action' => 'new',
		), 'default', true ); ?>">New Recipe</a></li>
		</ul></li>
	<?php else: ?>
		<li><h2><a href="/login/">Login</a> / <a href="/user/new">Register</a></h2></li>
	<?php endif ?>
	</ul>
	<ul>
		<li><h2><a href="http://cookingwithzend.blogspot.com/">Blog</a></h2></li>
	</ul>
	</div>
	<!-- End Navigation -->

<!-- This next call will now include any content that was generated in the
     dispatching of a controllers action (or series of actions).  -->
<?= $this->layout()->content ?>

<!-- if your application requires it, this would be a great place to put a
     footer for all pages. -->

</body>
</html>
